package com.test.dto;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 *  实体
 *
 * @author kuke
 * @since 2022-03-14
 */
@Data
public class UserDTO  {


    @ApiModelProperty(value = "主键ID")
    private Long id;

    @ApiModelProperty(value = "姓名")
    private String name;
    

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "邮箱")
    private String email;

    private long page;
    private long pageSize;
    private long offset;
    private String startTime;
    private String endTime;
    private String sortKey;
    private String sortVal = "asc";

    public long offset() {
        long current = this.getPage();
        return current <= 1L ? 0L : (current - 1L) * this.getPageSize();
    }
}
